-- GENERATED SPELL FOR [Hakkari Blood Priest] --


function spell0_11340(pUnit, Event) --@Blood Funnel,Heal--
pUnit:FullCastSpellOnTarget(24617,pUnit)
pUnit:RegisterEvent('Sorts_11340', 10000, 1)
end

function spell1_11340(pUnit, Event) --@Dispel Magic,n/a--
pUnit:FullCastSpellOnTarget(17201,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11340', 641, 1)
end

function spell2_11340(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(24618,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_11340', 5000, 1)
end

function Sorts_11340(pUnit, Event)
local choix_sorts_11340 = math.random(0, 2)
if choix_sorts_11340 == 0 then
pUnit:RegisterEvent('spell0_11340', 1, 1)
end
if choix_sorts_11340 == 1 then
pUnit:RegisterEvent('spell1_11340', 1, 1)
end
if choix_sorts_11340 == 2 then
pUnit:RegisterEvent('spell2_11340', 1, 1)
end
end

function mob11340_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_11340', math.random(1500, 3000), 1)
end

function mob11340_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11340_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11340_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(11340, 1, 'mob11340_Action')
RegisterUnitEvent(11340, 2, 'mob11340_Leave')
RegisterUnitEvent(11340, 3, 'mob11340_Kill')
RegisterUnitEvent(11340, 4, 'mob11340_Die')
